
// import TableList from "@components/templates/tablelist";
import TableList from "@components/templates/customtablelist";
import { HttpFinanceUnfrozen } from '@/service/api/views';
import { mapState,mapGetters } from "vuex";
import compAdd from './add';
export default {
    props:['totalid'],
    mixins: [TableList],
    components: {
        compAdd
    },
    data() {
        return {
            // totals: 0,
            isMixin: true,
            Tools: {show: true},
            Tabs: {show: true},
            formData:{
                search:{
                }
            },
            Searchs: {
                show: true,
                labelWidth: 120,
            },
            Plugins: {show: true},
        }
    },
    methods: {
        ajaxRequest: HttpFinanceUnfrozen,
        interceptRequest (params) {
            if (params.search.BT_createdAt&&params.search.BT_createdAt[0]!='') {
                params.search.BT_createdAt = this.handleDateFormat(params.search.BT_createdAt[0],'yyyy-mm-dd') + ' ~ ' + this.handleDateFormat(params.search.BT_createdAt[1],'yyyy-mm-dd')
            }
            return params
        },
        handleOperates(params="", type,batch) {
            if(batch===true){
                params=(params||this.checkedData.join(','))+'';
                if(!params.length) return this.$Message.warning('请选择至少一条数据');
            }
            switch (type) {
                case 'add':
                    this.operate = {
                        show: true,
                        component: 'compAdd',
                        params,
                        type,
                        width:500,
                        title: "单据解冻",
                        showFooter:false,
                    }
                break
                
            }
        },
    },
    computed: {
        ...mapGetters('dictionary', ['getSysAllList']),
        // 搜索下拉框展示内容
        SearchsData() {
            return  [
                {
                    label: '组织',
                    key: 'EQ_organizationId',
                    tag: 'Select',
                    options: this.getSysAllList,
                    props:{
                        filterable:true,
                    },
                    show: true,
                },
                {
                    label: '运单号',
                    tag: 'Input',
                    key: 'EQ_trackingNo',
                    show:true,
                },

                {
                    label: '解冻日期',
                    tag: 'DatePicker',
                    key: 'BT_createdAt',
                    // hideSearchTip:true,
                    show:true,
                    props: {
                        options:this.options,
                        type: 'daterange',
                        confirm: false,
                    },
                    style: 'width:200px'
                },
            ]
        },
        ToolsData(){
            return [
                {
                    name: "单据解冻",
                    theme: 'primary',
                    operate: 'add',
                },
            ]
        },
        // table的展示数据
        columns() {
            return [{
                title: "账户组织",
                key: "organizationName",
                sortable: true,
            }, {
                title: "金额（USD）",
                key: "amount",
            }, {
                title: "单号",
                key: "trackingNo",
                sortable: true,
            }, {
                title: "解冻时间",
                key: "createdAt",
                sortable: true,
            }, {
                title: "解冻原因",
                key: "cause",
                sortable: true,
            }, {
                title: "操作人",
                key: "createdName",
            },];
        },
        
    },

};
